package com.lz.ccjdemo.act;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.facebook.shimmer.ShimmerFrameLayout;
import com.lz.ccjdemo.R;
import com.lz.ccjdemo.utils.ImgUtils;

/**
 * 骨架屏
 */
public class SkeletonScreenActivity extends Activity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_skeleton_screen);
        ShimmerFrameLayout shimmerLayout=findViewById(R.id.shimmerLayout);
        shimmerLayout.startShimmer();
        TextView tv=findViewById(R.id.tv);
        Button btn=findViewById(R.id.btn);
        ImageView iv=findViewById(R.id.iv);
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                tv.setText("TextView 1");
                btn.setText("Button 1");
                ImgUtils.showImg(SkeletonScreenActivity.this,R.mipmap.icon_splash,iv);
                shimmerLayout.hideShimmer();
            }
        },3000);

    }
}
